/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React from 'react';
import { Popconfirm } from 'antd';

interface Popconfirms {
  text: string;
  confirm: any;
  cancel?: any;
  okText: string;
  cancelText: string;
}

const KbPopconfirm: React.FC<Popconfirms> = (props: any) => {
  return (
    <Popconfirm
      placement='bottomRight'
      title={props.text}
      onConfirm={props.confirm}
      onCancel={props.cancel}
      okText={props.okText}
      cancelText={props.cancelText}
    >
      {props.children}
    </Popconfirm>
  );
};

KbPopconfirm.defaultProps = {
  confirm: () => {},
  cancel: () => {},
  text: '',
  okText: 'Yes',
  cancelText: 'No',
};

export default KbPopconfirm;
